package com.fingard.avatar.website.service.impl;

import com.fingard.avatar.website.model.po.LoginLogPo;
import com.fingard.avatar.website.dao.LoginLogMapper;
import com.fingard.avatar.website.service.LoginLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.time.LocalDateTime;

/**
 *  Service实现类
 *
 * @author 徐一涛
 * @date 2022-04-26
 */
@Slf4j
@Service
public class LoginLogServiceImpl extends ServiceImpl<LoginLogMapper, LoginLogPo> implements LoginLogService {

    @Override
    public void add(String ip, String userName, String msg) {
        LoginLogPo log = new LoginLogPo().setUserName(userName).setIp(ip).setMsg(msg).setCreateTime(LocalDateTime.now());
        save(log);
    }
}
